var async = require("async");
var renderEngin = require("../common/renderEngin");
exports.registerUncomplete = function(req, res) {
    use(["public/javascripts/registerUncomplete/init.js", "public/javascripts/service/registerUncompleteService.js"], function(PageComponent, registerUncompleteService) {
        var storage = {};
        var storage = {};
        registerUncompleteService.checkIsAuth({ headers: req.headers }, function (response) {
            if (response.errorCode === 0) {
                switch (response.data) {
                    case 0:
                        PageComponent = React.createFactory(PageComponent);
                        renderEngin.call(res, 'registerUncomplete', PageComponent, storage);
                        break;
                    case 1:
                        res.redirect('/ent_auth');
                        break;
                    case 2:
                        res.redirect('/ent_auth');
                        break;
                    default:
                        res.redirect('/login');
                        break;
                }
                
            } else {
                res.redirect('/login');
            }
        });
    });
}
